from . import db  # 导入数据库实例

class Swiper(db.Model):
    __tablename__ = 'swipers'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.String(255), nullable=False)
    url = db.Column(db.String(255), nullable=False)


    def to_dict(self):
        return {c.name: getattr(self, c.name) for c in self.__table__.columns}

